/**   
* @{#} ReserveWord.java Create on 2013-6-29 下午4:52:21   
*   
* Copyright (c) 2012 by Baidu.   
*/
package objtable.core;

import java.util.HashSet;

import objtable.exception.ReserveWordException;

/**   
* @author <a href="mailto:zhangbo07@baidu.com">zhangbo07</a>  
* @version 1.0   
*/

public class ReserveWord {
	static HashSet<String> words = new HashSet<String>();

	private ReserveWord() {
	}

	static {
		//属性名
		words.add("obj");
		words.add("objs");
		words.add("subs");
		words.add("t_sub");
		words.add("t_a");
		words.add("t_b");
		words.add("a");
		words.add("a_objs");
		words.add("b");
		words.add("b_objs");
		words.add("c");
		words.add("c_objs");
		words.add("int");
		words.add("double");
		words.add("long");

		//方法名
		words.add("println");
	}

	public static void checkWord(String word) {
		if (words.contains(word)) {
			throw new ReserveWordException(word);
		}
	}
}
